/*
 * Public Credit Information Sharing Platform(PCISP).
 * Copyright (c) 2019-2020 jsxzkingdee and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 * Please visit https://www.zhengxinsoft.com if you need additional information or have any questions.
 */

package com.platform.comm.config.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.convert.DurationUnit;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;
import java.time.temporal.ChronoUnit;

/**
 * @author coder
 */
@ConfigurationProperties(prefix = "jwt")
@Data
@Validated
public class JwtProperties {
    /**
     * request header key
     */
    @NotEmpty(message = "请求头部验证不能为空")
    private String header;

    /**
     * token 的header
     */
    @NotEmpty
    private String tokenHead;

    /**
     * 类型
     */
    private String type = "JWT";

    /**
     * 所属项目
     */
    private String audience = "platform";

    /**
     * 所属公司
     */
    private String issuer = "http://www.xzkingdee.com/";

    /**
     * 公钥文件地址
     */
    private String pubKeyFilePath;

    /**
     * 秘钥
     */
    private String secret;

    /**
     * Base64 密钥
     */
    private String base64Secret;

    /**
     * 过期时间
     */
    @DurationUnit(ChronoUnit.SECONDS)
    private Long expiration = 86400L;

    /**
     * JWT ID 唯一标识
     */
    private String jwtJti = "jti";

    /**
     * 过期日期
     */
    private String jwtExp = "exp";


}
